<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:0px;border:0px">
  <t:datagrid name="wzSupplyCheckList" checkbox="true" pagination="true" fitColumns="true" title="物资盘点" actionUrl="wzSupplyCheckController.do?datagrid" idField="id" sortName="createDate" fit="true" queryMode="group">
   <t:dgCol title="主键"  field="id"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="物资名称"  field="supplyId" query="true" dictionary="wz_supply,id,name" queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="物资编号"  field="supplySn"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="保养状况"  field="keepState" query="true" dictionary="keep_state" queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="偏差数量"  field="offsetNumber"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="处理结果"  field="dealResult" query="true" queryMode="single"  dictionary="dealresult" width="120"></t:dgCol>
   <t:dgCol title="审批状态"  field="auditState"  hidden="true"  queryMode="single"  dictionary="bpm_status"  width="120"></t:dgCol>
   <t:dgCol title="系统库存"  field="qty"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="实际库存"  field="realQty"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="盘点人"  field="creatorId" query="true" dictionary="t_s_base_user,id,realname" queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="盘点日期"  field="checkDate"  formatter="yyyy-MM-dd"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="登记日期"  field="createDate"  formatter="yyyy-MM-dd"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="操作" field="opt" width="100"></t:dgCol>
   <t:dgDelOpt title="删除" url="wzSupplyCheckController.do?doDel&id={id}" urlclass="ace_button"  urlfont="fa-trash-o"/>
   <t:dgToolBar title="录入" icon="icon-add" url="wzSupplyCheckController.do?goAdd" funname="add"  width="768"></t:dgToolBar>
   <t:dgToolBar title="查看" icon="icon-search" url="wzSupplyCheckController.do?goUpdate" funname="detail"  width="768"></t:dgToolBar>
   <t:dgToolBar title="平库存" icon="icon-search" funname="doBalance"  width="768"></t:dgToolBar>
   <t:dgToolBar title="导出" icon="icon-putout" funname="ExportXls"></t:dgToolBar>
  </t:datagrid>
  </div>
 </div>
 <script type="text/javascript">
 $(document).ready(function(){
 });
 
 function doBalance(){
	 var rows = $('#wzSupplyCheckList').datagrid('getSelections');
	 if(rows.length==0){
		 layer.msg("请选择记录",{icon:0});
		 return;
	 }
	 layer.confirm("确定平库存吗？",function(index){
		 var ids = '';
		 for(var i=0;i<rows.length;i++){
			ids+=rows[i]["id"];
			ids+=',';
		 }
		ids = ids.substring(0,ids.length-1);
		$.ajax({
			url:'<c:url value="/wzSupplyCheckController.do?doBalance"/>',
			type:'POST',
			dataType:'json',
			data:{ids:ids},
			success:function(ret){
				wzSupplyCheckListsearch();
				layer.close(index);
			}
		})
	 })
	 
	 
 }
//导入
function ImportXls() {
	openuploadwin('Excel导入', 'wzSupplyCheckController.do?upload', "wzSupplyCheckList");
}

//导出
function ExportXls() {
	JeecgExcelExport("wzSupplyCheckController.do?exportXls","wzSupplyCheckList");
}

//模板下载
function ExportXlsByT() {
	JeecgExcelExport("wzSupplyCheckController.do?exportXlsByT","wzSupplyCheckList");
}

//bootstrap列表图片格式化
function btListImgFormatter(value,row,index){
	return listFileImgFormat(value,"image");
}
//bootstrap列表文件格式化
function btListFileFormatter(value,row,index){
	return listFileImgFormat(value);
}

</script>
